package com.tadpole.music.adapter.question;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.tadpole.music.R;
import com.tadpole.music.adapter.base.BaseAdapter;
import com.tadpole.music.holder.base.BaseViewHolder;
import com.tadpole.music.holder.question.KeyKnowledgeViewHolder;

/**
 * 重点知识
 * Created By 孙岩
 * on 2020/9/14
 */
public class KeyKnowledgeAdapter extends BaseAdapter {
    private OnChildClickListener onChildClickListener;
    private Activity activity;
    private KeyKnowledgeViewHolder keyKnowledgeViewHolder;

    public KeyKnowledgeAdapter(Activity activity){
        this.activity = activity;
    }

    @Override
    public BaseViewHolder createRelHolder(ViewGroup parent, int viewType) {
        keyKnowledgeViewHolder = new KeyKnowledgeViewHolder( LayoutInflater.from(activity).inflate(R.layout.item_key_knowledge, parent, false),onChildClickListener);
        return keyKnowledgeViewHolder;
    }

    @Override
    public int getRelItemCount() {
        return 4;
    }

    @Override
    public void setOnItemClickListener(OnItemClickListener listener) {

    }

    @Override
    public void setOnChildClickListener(OnChildClickListener listener) {
        this.onChildClickListener = listener;
    }

    @Override
    public void setOnLongClickListener(OnLongClickListener listener) {

    }

    @Override
    public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
        holder.init(position - mHeadViews.size());
    }
}
